package com.hxzy.tms.dao.impl;

import java.util.List;

import com.hxzy.tms.dao.HibernateBaseDao;
import com.hxzy.tms.dao.TeamUserDao;
import com.hxzy.tms.entity.TeamUser;
import com.hxzy.tms.entity.User;

public class DefaultTeamUserDao extends HibernateBaseDao<TeamUser> implements TeamUserDao {

    public List<User> teamUsers(long teamId) {
        List<User> users = getSession().getNamedQuery("teamUsers").setLong("teamId", teamId).list();
        return users;
    }

    public List<?> userTeams(long userId) {
        List<?> users = getSession().getNamedQuery("userTeams").setLong("userId", userId).list();
        return users;
    }

}
